package com.gpframework.module.ctn.domain.req;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gpframework.common.utils.StringUtils;
import com.gpframework.module.base.domain.req.BaseReq;
import com.gpframework.module.ctn.domain.GpSmsSendLog;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @ClassName GpSmsSendLogReq
 * @Author gpframework
 * @Date 2024-01-09
 * @Version 1.0.0
 * @Description 列表查询信息体
 */
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
public class GpSmsSendLogReq extends BaseReq {
    private static final long serialVersionUID = 1L;

         @ApiModelProperty("主键ID")
     private Long id;
     @ApiModelProperty("打包信息ID")
     private Long packId;
     @ApiModelProperty("订单ID")
     private Long receiptId;
     @ApiModelProperty("发送类型  1:APP端登录 2:绑定手机 3:提现手机 4:后台登录")
     private String smsType;
     @ApiModelProperty("发送模板")
     private String templateCode;
     @ApiModelProperty("货柜序货柜序号")
     private String agentCtnNo;
     @ApiModelProperty("品牌id")
     private Long brandId;
     @ApiModelProperty("店铺id")
     private Long storeId;
     @ApiModelProperty("品牌名称")
     private String brandName;
     @ApiModelProperty("店铺名称")
     private String storeName;
     @ApiModelProperty("供应商名称")
     private String supplier;
     @ApiModelProperty("供应商号码")
     private String supplierTel;
     @ApiModelProperty("客户名")
     private String customer;
     @ApiModelProperty("客户电话号码")
     private String customerTel;
     @ApiModelProperty("进仓单号")
     private String receiptNo;
     @ApiModelProperty("方cbm")
     private BigDecimal cbm;
     @ApiModelProperty("数量")
     private String number;
     @ApiModelProperty("接收手机")
     private String mobile;
     @ApiModelProperty("发送内容")
     private String sendContent;
     @ApiModelProperty("响应内容")
     private String responseContent;
    /** 发送状态 0未发送，1已发送 */
    @ApiModelProperty("发送状态 0未发送，1已发送")
    private String sendStatus;

    /** 散货信息ID */
    private Long sackId;
     @ApiModelProperty("备注")
     private String remarks;
    @ApiModelProperty("货柜到市场发送短信时间")
    private Date smsToMarketDate;
    @ApiModelProperty("装柜ID")
    private Long ctnLoadedId;
    @ApiModelProperty("订货柜ID")
    private Long ctnOrderId;

    /**
    * @Description 生成查询wrapper
    * @Author greatplan@qq.com
    * @Date 2020-11-04 16:04
    * @Param [lqw]
    * @Param [isVO] 是否vo查询体，true的话走的是mapper.xml里面的查询语句，不过查询语法还是mybatis-plus，主要用于某些关联查询出一些非数据表字段
    * @Return void
    */
    public void generatorQuery(QueryWrapper<GpSmsSendLog> lqw,boolean isVo) {
        String alias = "";
        if (isVo) {
            alias = "gp.";
            lqw.eq(alias+"del_status",0);
        }
        if (this.getId() != null){
        lqw.eq(alias+"id" ,this.getId());
        }
        if (this.getPackId() != null){
        lqw.eq(alias+"pack_id" ,this.getPackId());
        }
        if (this.getReceiptId() != null){
        lqw.eq(alias+"receipt_id" ,this.getReceiptId());
        }
        if (StringUtils.isNotBlank(this.getSmsType())){
        lqw.eq(alias+"sms_type" ,this.getSmsType());
        }
        if (StringUtils.isNotBlank(this.getTemplateCode())){
        lqw.eq(alias+"template_code" ,this.getTemplateCode());
        }
        if (StringUtils.isNotBlank(this.getAgentCtnNo())){
        lqw.eq(alias+"agent_ctn_no" ,this.getAgentCtnNo());
        }
        if (this.getBrandId() != null){
        lqw.eq(alias+"brand_id" ,this.getBrandId());
        }
        if (this.getStoreId() != null){
        lqw.eq(alias+"store_id" ,this.getStoreId());
        }
        if (StringUtils.isNotBlank(this.getBrandName())){
            lqw.like(alias+"brand_name",this.getBrandName());
        }
        if (StringUtils.isNotBlank(this.getStoreName())){
            lqw.like(alias+"store_name",this.getStoreName());
        }
        if (StringUtils.isNotBlank(this.getSupplier())){
        lqw.eq(alias+"supplier" ,this.getSupplier());
        }
        if (StringUtils.isNotBlank(this.getSupplierTel())){
        lqw.eq(alias+"supplier_tel" ,this.getSupplierTel());
        }
        if (StringUtils.isNotBlank(this.getCustomer())){
        lqw.eq(alias+"customer" ,this.getCustomer());
        }
        if (StringUtils.isNotBlank(this.getCustomerTel())){
        lqw.eq(alias+"customer_tel" ,this.getCustomerTel());
        }
        if (StringUtils.isNotBlank(this.getReceiptNo())){
        lqw.eq(alias+"receipt_no" ,this.getReceiptNo());
        }
        if (this.getCbm() != null){
        lqw.eq(alias+"cbm" ,this.getCbm());
        }
        if (StringUtils.isNotBlank(this.getNumber())){
        lqw.eq(alias+"number" ,this.getNumber());
        }
        if (StringUtils.isNotBlank(this.getMobile())){
        lqw.eq(alias+"mobile" ,this.getMobile());
        }
        if (StringUtils.isNotBlank(this.getSendContent())){
        lqw.eq(alias+"send_content" ,this.getSendContent());
        }
        if (StringUtils.isNotBlank(this.getResponseContent())){
        lqw.eq(alias+"response_content" ,this.getResponseContent());
        }
        if (StringUtils.isNotBlank(this.getSendStatus())){
        lqw.eq(alias+"send_status" ,this.getSendStatus());
        }
        if (StringUtils.isNotBlank(this.getRemarks())){
        lqw.eq(alias+"remarks" ,this.getRemarks());
        }
    }
}
